Skip to content

feat(Segment membership inspection): Add identifier search to the segment members endpoint#7866

Merged
khvn26 merged 1 commit into
feat/segment-membership-read-endpointfrom
feat/segment-members-search
Jun 24, 2026
Merged

feat(Segment membership inspection): Add identifier search to the segment members endpoint#7866
khvn26 merged 1 commit into
feat/segment-membership-read-endpointfrom
feat/segment-members-search

Conversation

@khvn26

@khvn26 khvn26 commented Jun 24, 2026

Copy link
Copy Markdown
Member

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Follow-up to #7861. Adds an optional q query param to the segment members endpoint so the matched identities can be searched by identifier.

GET /api/v1/projects/{id}/segments/{id}/members?environment={env_id}&q={term}

How did you test this code?

Added integration/unit tests. Will be tested along with #7864.

@khvn26 khvn26 requested review from a team as code owners June 24, 2026 15:24
@khvn26 khvn26 requested review from emyller and removed request for a team June 24, 2026 15:24
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jun 24, 2026 3:45pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ignored Ignored Preview Jun 24, 2026 3:45pm
flagsmith-frontend-staging Ignored Ignored Preview Jun 24, 2026 3:45pm

Request Review

@github-actions github-actions Bot added api Issue related to the REST API docs Documentation updates feature New feature or request and removed docs Documentation updates labels Jun 24, 2026
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-7866 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-7866 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-7866 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-7866 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-7866 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7866 Finished ✅ Results

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  38.3 seconds
commit  54b5694
info  🔄 Run: #17787 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  37.8 seconds
commit  54b5694
info  🔄 Run: #17787 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  33.2 seconds
commit  54b5694
info  🔄 Run: #17787 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  1 minute, 1 second
commit  54b5694
info  🔄 Run: #17787 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  21 passed

Details

stats  21 tests across 16 suites
duration  1 minute, 16 seconds
commit  4d2d373
info  🔄 Run: #17789 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  45.7 seconds
commit  4d2d373
info  🔄 Run: #17789 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

failed  1 failed

Details

stats  1 test across 1 suite
duration  21.6 seconds
commit  4d2d373
info  📦 Artifacts: View test results and HTML report
🔄 Run: #17789 (attempt 1)

Failed tests

firefox › tests/segment-test.pw.ts › Segment test 1 - Create, update, and manage segments with multivariate flags @oss

### Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  54.5 seconds
commit  4d2d373
info  🔄 Run: #17789 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  30.8 seconds
commit  4d2d373
info  🔄 Run: #17789 (attempt 2)

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

19 screenshots compared. See report for details.
View full report

@khvn26 khvn26 changed the title feat(segment-membership): Add identifier search to the segment members endpoint feat(Segment membership inspection): Add identifier search to the segment members endpoint Jun 24, 2026
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.59%. Comparing base (f38f7ce) to head (4d2d373).

Additional details and impacted files
@@                            Coverage Diff                            @@
##           feat/segment-membership-read-endpoint    #7866      +/-   ##
=========================================================================
- Coverage                                  98.60%   98.59%   -0.01%     
=========================================================================
  Files                                       1476     1475       -1     
  Lines                                      57832    57527     -305     
=========================================================================
- Hits                                       57026    56721     -305     
  Misses                                       806      806              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…s endpoint

Add an optional `q` query param to GET /projects/{id}/segments/{id}/members
that filters returned members by a case-insensitive substring of their
identifier, applied across the whole segment-matching set (in the ClickHouse
WHERE, before ORDER BY/LIMIT) rather than within a page.

The members action now fetches the segment by pk directly instead of via
get_queryset(), which applies the segment-list `q` (segment-name search) and
would otherwise filter the segment out when `q` is used to search members.

beep boop
@khvn26 khvn26 force-pushed the feat/segment-members-search branch from 54b5694 to 4d2d373 Compare June 24, 2026 15:45
@github-actions github-actions Bot added docs Documentation updates feature New feature or request and removed feature New feature or request docs Documentation updates labels Jun 24, 2026

@Zaimwa9 Zaimwa9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. One non-blocking comment would be that I wonder whether we could find a more elegant way to deal with this workaround but that's really NIT and not worth spending too much time on it imo

@khvn26 khvn26 merged commit 67c44d3 into feat/segment-membership-read-endpoint Jun 24, 2026
42 of 43 checks passed
@khvn26 khvn26 deleted the feat/segment-members-search branch June 24, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants